﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET?>" />
<link rel="stylesheet" href="css/common.css" type="text/css" />

 <script type="text/javascript" charset="utf-8" src="./kindeditor/kindeditor.js"></script>
 <script type="text/javascript">
    KE.show({
        id : 'about',
        cssPath : './kindeditor/index.css',
		urlType : 'absolute'
    });
  </script>

<title>管理区域</title>
</head>

<body>
<div id="man_zone">

<form action="?action=edit" method="post" enctype="multipart/form-data">
<input name="sid" type="hidden" id="sid" value="<?php echo $sid;?>" />
  <table width="99%" border="0" align="center"  cellpadding="3" cellspacing="1" class="table_style">
    <tr>
      <td width="15%" align="right" class="left_title_1">商家名称：</td>
      <td width="85%"><input name="name" type="text" id="name" value="<?php echo $value['name'];?>" /></td>
    </tr>
    <tr>
      <td align="right" class="left_title_2">商家网址：</td>
      <td><input name="web" type="text" id="web" value="<?php echo $value['web'];?>" /></td>
    </tr>
    <tr>
      <td align="right" class="left_title_1">商家图片：</td>
      <td><input name="fileimg[]" type="file" id="fileimg[]" /><img onerror="this.src='images/noimg.gif'" src="/<?php echo $value['img'];?>" width="80" height="50" /><input name="imgold" type="hidden" id="imgold" value="<?php echo $value['img'];?>" /></td>
    </tr>
    <tr>
      <td align="right" class="left_title_2">商家地址：</td>
      <td><input name="address" type="text" id="address" value="<?php echo $value['address'];?>" /></td>
    </tr>
    <tr>
      <td align="right" class="left_title_1">商家地图标注：</td>
      <td><input name="map" type="text" id="map" value="<?php echo $value['map'];?>" readonly=true/>
	  
<input type="button" id="btn_addMarker" disabled value="标注位置" onclick="AddMarker()" class="btn" /> 
<div id="d_map" style="background-color:#FFF;border:solid 6px gray;width:581px;margin-top:3px;">
<div style="width:580px; height:300px;background-color:#f3f3f3;" id="map_canvas"></div></div>
<?php if(!empty($value['map']))list($xx,$yy,$zz)=explode(',',$value['map']);?>

<input type="hidden" name="lat" id="lat" value="<?php echo $xx;?>" />
<input type="hidden" name="lng" id="lng" value="<?php echo $yy;?>" />
<input type="hidden" name="zoom" id="zoom" value="<?php echo $zz;?>" />
<script src="http://maps.google.com/maps?file=api&v=2&oe=gb2312&key=<?php echo $cfg_googlemap_key;?>&hl=zh-tw" type="text/javascript"></script>
<script type="text/javascript">
var myMap;
var myMarker;
window.onload = function() {
if (GBrowserIsCompatible()) {
myMap = new GMap2(document.getElementById("map_canvas"));
var center = new GLatLng(25.047795,121.516900); //这个地方就是调整默认显示哪里的，里面的经纬度,请在表格最下面查询，输入你所在的县市如果没有县级，请查询地级市，后面的前面2个数值串，就是经度和纬度，注意中间用，号隔开
myMap.addControl(new GLargeMapControl());
myMap.addControl(new GScaleControl());
myMap.enableScrollWheelZoom();
if (document.getElementById("lat").value == ""){
myMap.setCenter(center, 10);     //这个地方就是可以修改到显示多少级别的，如果想显示到街道级别，把10改为16就差不多了，可以自己//改改看
document.getElementById("btn_addMarker").disabled = false;
}
else{
var _lat = document.getElementById("lat").value;
var _lng = document.getElementById("lng").value;
var _zoom = document.getElementById("zoom").value;
var _center = new GLatLng(_lat,_lng);
myMap.setCenter(_center,parseInt(_zoom));
document.getElementById("btn_addMarker").disabled = true;
Mark(_lat,_lng);
}
}
}
function Mark(lat,lng){
myMarker = new GMarker(new GLatLng(lat,lng), {draggable: true});
GEvent.addListener(myMarker, "click", function() { 
myMarker.openInfoWindowHtml("<b>把气球拖动到你要标记的地方</b><p>拖动左边的比例尺可以缩放地图</p><a href='javascript:void(0);' onclick='DeleteMarker()'>删除标记</a>");
});
GEvent.addListener(myMarker, "dragstart", function() { 
myMarker.closeInfoWindow();
});
GEvent.addListener(myMarker, "dragend", function() {
var gll = myMarker.getLatLng();
document.getElementById("lat").value = gll.lat();
document.getElementById("lng").value = gll.lng();
document.getElementById("zoom").value = myMap.getZoom();
var mapstr="";
mapstr=gll.lat()+','+gll.lng()+','+myMap.getZoom();
document.getElementById("map").value=mapstr;
myMarker.openInfoWindowHtml("<b>把气球拖动到你要标记的地方</b><p>拖动左边的比例尺可以缩放地图</p><a href='javascript:void(0);' onclick='DeleteMarker()'>删除标记</a>");
});
myMap.addOverlay(myMarker);
myMarker.openInfoWindowHtml("<b>把气球拖动到你要标记的地方</b><p>拖动左边的比例尺可以缩放地图</p><a href='javascript:void(0);' onclick='DeleteMarker()'>删除标记</a>");
}
function AddMarker(){
document.getElementById("btn_addMarker").disabled = true;
var ll = myMap.getCenter();
document.getElementById("lat").value = ll.lat();
document.getElementById("lng").value = ll.lng();
document.getElementById("zoom").value = myMap.getZoom();
Mark(ll.lat(),ll.lng());
}
function DeleteMarker(){
document.getElementById("btn_addMarker").disabled = false;
myMap.removeOverlay(myMarker);
var gll = myMarker.getLatLng();
document.getElementById("lat").value = "";
document.getElementById("lng").value = "";
document.getElementById("zoom").value = "";
}
</script>
	  
	  </td>
    </tr>
    <tr>
      <td align="right" class="left_title_2">商家电话：</td>
      <td><input name="tel" type="text" id="tel" value="<?php echo $value['tel'];?>" /></td>
    </tr>
    <tr>
      <td align="right" class="left_title_1">营业时间：</td>
      <td>
	  
	  <textarea name="operating_time" cols="50" rows="4" id="operating_time"><?php echo $value['operating_time'];?></textarea>
	  </td>
    </tr>
    <tr>
      <td align="right" class="left_title_2">条码类型：</td>
      <td>
	  <SELECT style="WIDTH: 300px" onchange="" size=1 name=codebar>
	 <OPTION value=BCGcodabar <?php if($value['codebar']=='BCGcodabar')echo "selected='selected'"?>>Codabar</OPTION>
	 <OPTION value=BCGcode11 <?php if($value['codebar']=='BCGcode11')echo "selected='selected'"?>>Code 11</OPTION> 
	 <OPTION value=BCGcode39 <?php if($value['codebar']=='BCGcode39')echo "selected='selected'"?>>Code 39</OPTION> 
	 <OPTION value=BCGcode39extended <?php if($value['codebar']=='BCGcode39extended')echo "selected='selected'"?>>Code 39 Extended</OPTION> 
	 <OPTION value=BCGcode93 <?php if($value['codebar']=='BCGcode93')echo "selected='selected'"?>>Code 93</OPTION>
	 <OPTION value=BCGcode128 <?php if($value['codebar']=='BCGcode128')echo "selected='selected'"?>>Code 128</OPTION>
	 <OPTION value=BCGean8 <?php if($value['codebar']=='BCGean8')echo "selected='selected'"?>>EAN-8</OPTION> 
	 <OPTION value=BCGean13 <?php if($value['codebar']=='BCGean13')echo "selected='selected'"?>>EAN-13</OPTION> 
	 <OPTION value=BCGisbn <?php if($value['codebar']=='BCGisbn')echo "selected='selected'"?>>ISBN-10 / ISBN-13</OPTION> 
	 <OPTION value=BCGi25 <?php if($value['codebar']=='BCGi25')echo "selected='selected'"?>>Interleaved 2 of 5</OPTION> 
	 <OPTION value=BCGs25 <?php if($value['codebar']=='BCGs25')echo "selected='selected'"?>>Standard 2 of 5</OPTION> 
	 <OPTION value=BCGmsi <?php if($value['codebar']=='BCGmsi')echo "selected='selected'"?>>MSI Plessey</OPTION> 
	 <OPTION value=BCGupca <?php if($value['codebar']=='BCGupca')echo "selected='selected'"?>>UPC-A</OPTION> 
	 <OPTION value=BCGupce <?php if($value['codebar']=='BCGupce')echo "selected='selected'"?>>UPC-E</OPTION> 
	 <OPTION value=BCGupcext2 <?php if($value['codebar']=='BCGupcext2')echo "selected='selected'"?>>UPC Extension 2 Digits</OPTION> 
	 <OPTION value=BCGupcext5 <?php if($value['codebar']=='BCGupcext5')echo "selected='selected'"?>>UPC Extension 5 Digits</OPTION> 
	 <OPTION value=BCGpostnet <?php if($value['codebar']=='BCGpostnet')echo "selected='selected'"?>>PostNet</OPTION> 
	 <OPTION value=BCGothercode <?php if($value['codebar']=='BCGothercode')echo "selected='selected'"?>>Other Barcode</OPTION>
 </SELECT>	  </td>
    </tr>
    <tr>
      <td align="right" class="left_title_1">条形码大小：</td>
      <td>
	  <SELECT style="WIDTH: 300px" onchange="" size=1 name=resolution> 
	<OPTION value=1 <?php if($value['resolution']==1)echo "selected='selected'"?>>1号</OPTION> 
	<OPTION value=2 <?php if($value['resolution']==2)echo "selected='selected'"?>>2号</OPTION> 
	<OPTION value=3 <?php if($value['resolution']==3)echo "selected='selected'"?>>3号</OPTION>
      </SELECT>	  </td>
    </tr>
    <tr>
      <td align="right" class="left_title_1">公交线路：</td>
      <td><textarea name="bus" cols="50" rows="4" id="bus"><?php echo $value['bus'];?></textarea></td>
    </tr>
    <tr>
      <td align="right" class="left_title_1">商家简介：</td>
      <td><textarea name="brief" cols="50" rows="4" id="brief"><?php echo $value['brief'];?></textarea></td>
    </tr>
    <tr>
      <td align="right" class="left_title_1">商家描述：</td>
      <td><textarea name="about" id="about" cols="50" rows="4" id="about" style="width:700px;height:200px;visibility:hidden;"><?php echo $value['about'];?></textarea></td>
    </tr>
    <tr bgcolor="#FFFFFF">
      <td align="right" class="left_title_2">商家密码：</td>
      <td><input name="pwd" type="text" id="pwd" value="<?php echo $value['pwd'];?>" /></td>
    </tr>
    <tr bgcolor="#FFFFFF">
      <td align="right" class="left_title_2">&nbsp;</td>
      <td><input type="submit" name="Submit" value="提交" />
         &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <input type="reset" name="Submit2" value="重置" /></td>
    </tr>
  </table>
  </form>
</div>
</body>
</html>
